package com.yc.hotel.room.feign;


import java.util.List;
import java.util.Map;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import com.yc.hotel.dto.RoomInfoDTO;

@FeignClient(name="room-server", fallback = IRoomInfoFeignClient.RoomInfoFeignClientFallBack.class)
public interface IRoomInfoFeignClient {
	
	@PostMapping("/rooms/findByRno")
	RoomInfoDTO findByRno(@RequestParam int rno);
	
	@PostMapping("/rooms/updateStatus")
	int updateStatus(@RequestParam Map<String, Object> map);
	
	@PostMapping("/rooms/endSale")
	int endSale(@RequestBody RoomInfoDTO room);
	
	@PostMapping("/rooms/finds")
	List<RoomInfoDTO> finds(@RequestParam Map<String, Object> map);
	
	@PostMapping("/rooms/add")
	int add(@RequestBody RoomInfoDTO room);
	
	@Component
	public static class RoomInfoFeignClientFallBack implements IRoomInfoFeignClient {

		@Override
		public RoomInfoDTO findByRno(int rno) {
			// TODO Auto-generated method stub
			return null;
		}

		@Override
		public int updateStatus(Map<String, Object> map) {
			// TODO Auto-generated method stub
			return 0;
		}

		@Override
		public int endSale(RoomInfoDTO room) {
			// TODO Auto-generated method stub
			return 0;
		}

		@Override
		public List<RoomInfoDTO> finds(Map<String, Object> map) {
			// TODO Auto-generated method stub
			return null;
		}

		@Override
		public int add(RoomInfoDTO rf) {
			// TODO Auto-generated method stub
			return 0;
		}
		
	}

	

	

}
